﻿
namespace BEGDC.PreContract.DAL
{
    using System;
    using System.Collections.Generic;
    using Castle.ActiveRecord;
    using NHibernate.Expression;


    [ActiveRecord]
    public partial class OperationLog : ActiveRecordBase<OperationLog>
    {
		#region Const Definition
		
		public const string CONST_OperationLogID						= "OperationLogID";
		public const string CONST_EmployeeName							= "EmployeeName";
		public const string CONST_OperationType							= "OperationType";
		public const string CONST_LogContent							= "LogContent";
		public const string CONST_OperationDate							= "OperationDate";
		public const string CONST_HostName								= "HostName";
		public const string CONST_HostIP								= "HostIP";

		#endregion
		
        #region Member Variables
        // Primary Key
        private System.Int32 _operationLogID;
        
        // Non Key
        private System.String _employeeName;
        private System.String _operationType;
        private System.String _logContent;
        private Nullables.NullableDateTime _operationDate;
        private System.String _hostName;
        private System.String _hostIP;

        // Parents
        
        
		

        #endregion

        public OperationLog() {
               
        }
        public OperationLog(
            System.String employeeName
            ,System.String operationType
            ,System.String logContent
            ,Nullables.NullableDateTime operationDate
            ,System.String hostName
            ,System.String hostIP) : this() {
                
            this._employeeName = employeeName; 
            this._operationType = operationType; 
            this._logContent = logContent; 
            this._operationDate = operationDate; 
            this._hostName = hostName; 
            this._hostIP = hostIP; 
        }
        
        #region Properties
        // Primary Key        
		
		#if (SQLServer)
        [PrimaryKey]
		#else
		[PrimaryKey(PrimaryKeyType.Native, SequenceName = "SEQ_OPERATIONLOG_OPERATIONLOGID")]
		#endif
        public System.Int32 OperationLogID {
            get { return this._operationLogID; }
            set {  this._operationLogID = value; }
        }
        
        // Non Key
        [Property]
        public System.String EmployeeName {
            get { return this._employeeName; }
			set { if (value == null) return; if (value.Length > 50) this._employeeName = value.Substring(0,50); else this._employeeName = value; }	
        }
        
        [Property]
        public System.String OperationType {
            get { return this._operationType; }
			set { if (value == null) return; if (value.Length > 50) this._operationType = value.Substring(0,50); else this._operationType = value; }	
        }
        
        [Property]
        public System.String LogContent {
            get { return this._logContent; }
			set { if (value == null) return; if (value.Length > 4000) this._logContent = value.Substring(0,4000); else this._logContent = value; }	
        }
        
        [Property]
        public Nullables.NullableDateTime OperationDate {
            get { return this._operationDate; }
			set { this._operationDate = value; }
        }
        
        [Property]
        public System.String HostName {
            get { return this._hostName; }
			set { if (value == null) return; if (value.Length > 100) this._hostName = value.Substring(0,100); else this._hostName = value; }	
        }
        
        [Property]
        public System.String HostIP {
            get { return this._hostIP; }
			set { if (value == null) return; if (value.Length > 50) this._hostIP = value.Substring(0,50); else this._hostIP = value; }	
        }
        
        
        // Parent Relationships
        // Child Relationships
        
		
        #endregion
		
		// Clone
		public OperationLog Clone()
		{
			OperationLog newOperationLog = new OperationLog();
			
            newOperationLog.EmployeeName = this._employeeName; 
            newOperationLog.OperationType = this._operationType; 
            newOperationLog.LogContent = this._logContent; 
            newOperationLog.OperationDate = this._operationDate; 
            newOperationLog.HostName = this._hostName; 
            newOperationLog.HostIP = this._hostIP; 
			return newOperationLog;
		}
    }
}



